<template>
    <popup-select v-model:show="showPop" :lists="mbList" @change="onChange" @confirm="onConfirm" title="类型" @close="close"/>
</template>
<script setup>
import { ref,onMounted,nextTick ,watch} from "vue";
import popupSelect from "@/components/popupSelect.vue"

const props = defineProps({
    show:{
        type:Boolean,
        default:false 
    },
})

const emit = defineEmits(['update:show','confirm','change'])

const mbList = ref([
    {name:'全部',id:2},
    {name:'企业发表',id:0},
    {name:'个人发表',id:1}
])
const showPop = ref(false)

watch(()=>props.show,(newData,oldData)=>{
    showPop.value = newData
})

const onChange = (data) =>{
    //console.log("yyy1:",data)
    emit('change',data)
}

const onConfirm = (data)=>{
    //console.log("yyy2:",data)
    emit('confirm',data)
    emit('update:show', false)
}
const close = ()=>{
    emit('update:show', false)
}
</script>